/*
 * Copyright 2011 Sequent Software Inc.  All Rights Reserved.
 */
package com.nexttwist.common;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;

import org.apache.cxf.jaxrs.impl.ResponseBuilderImpl;

/**
 * Util
 * 
 * This class contains common response method
 * 
 * @author 
 * @version 0.1
 */
public class Util {
	
	/**
	 * This method returns the Object as Response
	 * @param object
	 * @return
	 */
	public static Response successResponse(Object object) {
		ResponseBuilder response;
		response = Response.ok(object);
		return response.build();
	}
	
	public static Response failureResponse(String msg){
		ResponseBuilder rb =new ResponseBuilderImpl();
		return rb.entity(msg).status(500).build();
	}
}